package cn.sumpu.app.guoguojie.biz;

import java.util.List;
import java.util.Map;

import cn.sumpu.app.guoguojie.domain.Friend;
import cn.sumpu.app.guoguojie.domain.Group;
import cn.sumpu.app.guoguojie.domain.Member;
import cn.sumpu.app.guoguojie.exception.AppBusinessException;
import cn.sumpu.app.guoguojie.domain.Ext.FriendFamily;
import cn.sumpu.app.guoguojie.domain.Ext.PageModel;

public interface FriendBiz {
	/**
	 * 按email查找
	 * @param email
	 * @return
	 * @throws AppBusinessException
	 */
	public FriendFamily searchFriendEmail(String myFamily,String email) throws AppBusinessException;

	/**
	 * 按门牌号查找
	 * @param doorplate
	 * @return
	 * @throws AppBusinessException
	 */
	public FriendFamily searchFriendDoorplate(String myFamily,String doorplate)
			throws AppBusinessException;
	
	//根据标签名称查找好友
	public PageModel searchFriendByTag(String tagName,String doorplate, Integer page)throws AppBusinessException;

	/**
	 * 按条件查找好友
	 * @param hostName
	 * @param fnickName
	 * @param sex
	 * @param birthday
	 * @param birthPro
	 * @param birthCity
	 * @param birthDic
	 * @param residePro
	 * @param resideCity
	 * @param resideDic
	 * @param babyName
	 * @return
	 * @throws AppBusinessException
	 */
	public List<FriendFamily> searchFriendCondition(String hostName, String fnickName,
			String sex, String birthday, String birthPro, String birthCity,
			String birthDic, String residePro, String resideCity,
			String resideDic, String babyName)throws AppBusinessException;

	public PageModel searchFriendCondition(String myFamily,String hostName, String fnickName,
			String sex, String birthday, String birthPro, String birthCity,
			String birthDic, String residePro, String resideCity,
			String resideDic, String babyName,Integer page) throws AppBusinessException ;
	/**
	 * 邀请好友
	 * @param friend
	 * @throws AppBusinessException
	 */
	public void inviteFriend(Friend friend) throws AppBusinessException;
	
	/**
	 * 同意好友邀请
	 * @param member
	 * @param friend
	 * @throws AppBusinessException
	 */
	public void agreeFriend(Member member,String friend,String msgId) throws AppBusinessException;
	
	
	/**
	 * 忽略好友邀请
	 * @param member
	 * @param friend
	 * @throws AppBusinessException
	 */
	public void ignoreFriend(Member member,String friend,String msgId) throws AppBusinessException;
	
	
	/**
	 * 新建好友分组
	 * @param member
	 * @param name
	 * @param remark
	 * @throws AppBusinessException
	 */
	public Group createGroup(String family,String name,String classify,String remark)throws AppBusinessException;
	
	/**
	 * 得到会员的好友分组
	 * @param member
	 * @throws AppBusinessException
	 */
	public List<Group> getGroupList(String family)throws AppBusinessException;
	
	/**
	 * 可能认识的人
	 * @param member
	 * @return
	 * @throws AppBusinessException
	 */
	public PageModel maybeFriends(String myFamily,Integer page)throws AppBusinessException;
	/**
	 * 可能认识的人主页
	 * @param member
	 * @return
	 * @throws AppBusinessException
	 */
	public List<FriendFamily> maybeFriendsMain(String myFamily)throws AppBusinessException;
	

	public void deleteFriend(String friend, String family)throws AppBusinessException;
	
	/**
	 * 得到我的家的好友
	 * @param member
	 * @param page
	 * @return
	 * @throws AppBusinessException
	 */
	public PageModel getMyFriendsFamily(String family,String group,Integer page)throws AppBusinessException;
	
	public List<FriendFamily> getMyFriendsFamilySize(String family,Integer size) throws AppBusinessException;
	/**
	 * 更新好友分组
	 * @param map
	 * @throws AppBusinessException
	 */
	public void updateFriendGroup(String friendId,String group)throws AppBusinessException;
	
	public void friendAddSave(Member member,String family,String content)throws AppBusinessException;
	
	public Group getGroupDefault(String family)throws AppBusinessException;
	
	
	public Group addFriendGroup(String family ,String groupName,String friendId)throws AppBusinessException;
	
	public void deleteGroup(String id,String family,String friendId)throws AppBusinessException;
	
	public void updateFriendShield(boolean shield,String friendId)throws AppBusinessException;
	
	/**
	 * 查看俩家是否是好友
	 * @param myDoorplate		自己家的门牌号
	 * @param friendDoorplate	好友家的门牌号
	 * @return					0（不是好友）或1（是好友）
	 * @throws AppBusinessException
	 */
	public Integer getFriendByFamily(Map<String, Object> map)throws AppBusinessException;
	
}
